<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QSculpt: data::QuadTree&lt; T &gt; Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QSculpt
   &#160;<span id="projectnumber">0.0.1a</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>data</b>      </li>
      <li class="navelem"><a class="el" href="classdata_1_1_quad_tree.html">QuadTree</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">data::QuadTree&lt; T &gt; Class Template Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="data::QuadTree" --><!-- doxytag: inherits="data::ICollection" --><div class="dynheader">
Inheritance diagram for data::QuadTree&lt; T &gt;:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classdata_1_1_quad_tree.png" usemap="#data::QuadTree&lt; T &gt;_map" alt=""/>
  <map id="data::QuadTree&lt; T &gt;_map" name="data::QuadTree&lt; T &gt;_map">
<area href="classdata_1_1_i_collection.html" alt="data::ICollection&lt; T &gt;" shape="rect" coords="0,0,132,24"/>
</map>
 </div></div>

<p><a href="classdata_1_1_quad_tree-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree_1_1_quad_tree_node.html">QuadTreeNode</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8852d3b84536ff2912d77d19f1f3ca25"></a><!-- doxytag: member="data::QuadTree::QuadTree" ref="a8852d3b84536ff2912d77d19f1f3ca25" args="(const QuadTree&lt; T &gt; &amp;cpy)" -->
&#160;</td><td class="memItemRight" valign="bottom"><b>QuadTree</b> (const <a class="el" href="classdata_1_1_quad_tree.html">QuadTree</a>&lt; T &gt; &amp;cpy)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree.html#acb9b39d6fd0423a91dbd2037490ad6a4">add</a> (T *element)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree.html#aef96ae516be54188aed14f38cef403ca">remove</a> (T *element)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree.html#a90f6ff1e7613ce3977f8bdac75205d51">findClosest</a> (const Point3 &amp;p, float maxDistance=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree.html#a58bf0b3872ed283de43d683a5a514e37">findClosest</a> (const Point3 &amp;p, float maxDistance=0) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree.html#ae17112296b2713399a27d93e80bfed04">findFirstIntersect</a> (const <a class="el" href="classgeometry_1_1_ray.html">Ray</a> &amp;ray)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree.html#aa08440fff19deaf52971dd876747056c">findIntersect</a> (const <a class="el" href="classgeometry_1_1_ray.html">Ray</a> &amp;ray, <a class="el" href="classdata_1_1_i_collection.html">ICollection</a>&lt; T * &gt; bag=NULL)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae9667bbf918f71f9326f67db73aa184b"></a><!-- doxytag: member="data::QuadTree::findIntersect" ref="ae9667bbf918f71f9326f67db73aa184b" args="(const AABB &amp;box, ICollection&lt; T * &gt; bag=NULL)" -->
T *&#160;</td><td class="memItemRight" valign="bottom"><b>findIntersect</b> (const <a class="el" href="classgeometry_1_1_a_a_b_b.html">AABB</a> &amp;box, <a class="el" href="classdata_1_1_i_collection.html">ICollection</a>&lt; T * &gt; bag=NULL)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_iterator.html">Iterator</a>&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree.html#a0c5e3f45eb4631900673509b50ec61e3">iterator</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::vector&lt; T * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdata_1_1_quad_tree.html#a6515931b279a43c3122a5bdb924616c3">toStdVector</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a193deee4a35cc92c73b367fb6b374e1e"></a><!-- doxytag: member="data::QuadTree::toStdSet" ref="a193deee4a35cc92c73b367fb6b374e1e" args="()" -->
std::set&lt; T * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>toStdSet</b> ()</td></tr>
</table>
<h3>template&lt;typename T&gt;<br/>
 class data::QuadTree&lt; T &gt;</h3>

<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="acb9b39d6fd0423a91dbd2037490ad6a4"></a><!-- doxytag: member="data::QuadTree::add" ref="acb9b39d6fd0423a91dbd2037490ad6a4" args="(T *element)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classdata_1_1_quad_tree.html">data::QuadTree</a>&lt; T &gt;::add </td>
          <td>(</td>
          <td class="paramtype">T *&#160;</td>
          <td class="paramname"><em>element</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Add a new element to the collection.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">element</td><td>element to add to the collection. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a90f6ff1e7613ce3977f8bdac75205d51"></a><!-- doxytag: member="data::QuadTree::findClosest" ref="a90f6ff1e7613ce3977f8bdac75205d51" args="(const Point3 &amp;p, float maxDistance=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T * <a class="el" href="classdata_1_1_quad_tree.html">data::QuadTree</a>&lt; T &gt;::findClosest </td>
          <td>(</td>
          <td class="paramtype">const Point3 &amp;&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>maxDistance</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Find the closest element to the point p.</p>
<p>This function find the closest primitive to the point p that is whitin a maxDistance radius. By default the radius is -1, meaning that we don't care the minimum distance.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>query point to which we want to find the closest point to that </td></tr>
    <tr><td class="paramname">maxDistance</td><td>look for the closest points within this radius. If maxDistance is negative, just look for the closest point, no matter at what distance it is. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a58bf0b3872ed283de43d683a5a514e37"></a><!-- doxytag: member="data::QuadTree::findClosest" ref="a58bf0b3872ed283de43d683a5a514e37" args="(const Point3 &amp;p, float maxDistance=0) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">const T * <a class="el" href="classdata_1_1_quad_tree.html">data::QuadTree</a>&lt; T &gt;::findClosest </td>
          <td>(</td>
          <td class="paramtype">const Point3 &amp;&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>maxDistance</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Overload method </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classdata_1_1_quad_tree.html#a90f6ff1e7613ce3977f8bdac75205d51">findClosest</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae17112296b2713399a27d93e80bfed04"></a><!-- doxytag: member="data::QuadTree::findFirstIntersect" ref="ae17112296b2713399a27d93e80bfed04" args="(const Ray &amp;ray)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T * <a class="el" href="classdata_1_1_quad_tree.html">data::QuadTree</a>&lt; T &gt;::findFirstIntersect </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classgeometry_1_1_ray.html">Ray</a> &amp;&#160;</td>
          <td class="paramname"><em>ray</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Find an element that a given ray intersects it.</p>
<p>It returns the first element found that intersect the ray. This does not mean that it is the closest element with respect the ray.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ray</td><td>Ray to use for intersection test against every element. </td></tr>
    <tr><td class="paramname">bag</td><td>A <a class="el" href="classdata_1_1_i_collection.html">ICollection</a> object to insert the element found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa08440fff19deaf52971dd876747056c"></a><!-- doxytag: member="data::QuadTree::findIntersect" ref="aa08440fff19deaf52971dd876747056c" args="(const Ray &amp;ray, ICollection&lt; T * &gt; bag=NULL)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classdata_1_1_quad_tree.html">data::QuadTree</a>&lt; T &gt;::findIntersect </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classgeometry_1_1_ray.html">Ray</a> &amp;&#160;</td>
          <td class="paramname"><em>ray</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classdata_1_1_i_collection.html">ICollection</a>&lt; T * &gt;&#160;</td>
          <td class="paramname"><em>bag</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Find all the elements that intersects a given ray.</p>
<p>This method returns all element which pass through a given ray. Each element found is inserted in the collection bag. If no bag is passed (bag = NULL), then it just return if an intersections has occured.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">ray</td><td>Ray to use for intersection test against every element. </td></tr>
    <tr><td class="paramname">bag</td><td>A <a class="el" href="classdata_1_1_i_collection.html">ICollection</a> object to insert the element found.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a boolean value stating if an intersection acurred. </dd></dl>

</div>
</div>
<a class="anchor" id="a0c5e3f45eb4631900673509b50ec61e3"></a><!-- doxytag: member="data::QuadTree::iterator" ref="a0c5e3f45eb4631900673509b50ec61e3" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_iterator.html">Iterator</a>&lt; T &gt; <a class="el" href="classdata_1_1_quad_tree.html">data::QuadTree</a>&lt; T &gt;::iterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates an iterator over the collection class </p>

<p>Implements <a class="el" href="classdata_1_1_i_collection.html#ad7b76e3a3a7aedf051ab8cbf0ddb2b68">data::ICollection&lt; T &gt;</a>.</p>

</div>
</div>
<a class="anchor" id="aef96ae516be54188aed14f38cef403ca"></a><!-- doxytag: member="data::QuadTree::remove" ref="aef96ae516be54188aed14f38cef403ca" args="(T *element)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classdata_1_1_quad_tree.html">data::QuadTree</a>&lt; T &gt;::remove </td>
          <td>(</td>
          <td class="paramtype">T *&#160;</td>
          <td class="paramname"><em>element</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Removes a new element from the collection.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">element</td><td>element to remove from the collection. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a6515931b279a43c3122a5bdb924616c3"></a><!-- doxytag: member="data::QuadTree::toStdVector" ref="a6515931b279a43c3122a5bdb924616c3" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; T * &gt; <a class="el" href="classdata_1_1_quad_tree.html">data::QuadTree</a>&lt; T &gt;::toStdVector </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns all the elements in a std::vector. It copies the data into a std::vector&lt;&gt; class instance. The data has to be copiable/assignable. </p>

<p>Implements <a class="el" href="classdata_1_1_i_collection.html#a8b14debf48c6660c15145d2efefbc1f2">data::ICollection&lt; T &gt;</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>engine/include/<a class="el" href="_quadtree_8h_source.html">Quadtree.h</a></li>
<li>engine/src/QuadTree.cpp</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Thu May 31 2012 16:19:52 for QSculpt by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
